# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Zach Bacon <11doctorwhocanada@gmail.com>

_realname=libnotify
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.7.6
pkgrel=2
pkgdesc="Desktop notification library (mingw-w64)"
arch=('any')
url="https://developer.gnome.org/notification-spec/"
license=('LGPL')
depends=("${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-gtk3"
             "${MINGW_PACKAGE_PREFIX}-gobject-introspection"
             "${MINGW_PACKAGE_PREFIX}-pkg-config" )
source=("https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
        "introspection.patch"
        "test-fix.patch")
sha256sums=('0ef61ca400d30e28217979bfa0e73a7406b19c32dd76150654ec5b2bdf47d837'
            '7c5795ac0a74a2d5efdc13ae05d610acc8176fce7114ed6b9322be4f0ca710e9'
            '185e7885512106172627525a4ec1fc18c2f95844f733e49cece325874a55f8e6')

prepare() {
  cd $srcdir/${_realname}-${pkgver}
  patch -p1 -i ${srcdir}/introspection.patch
  patch -p1 -i ${srcdir}/test-fix.patch
}

build() {
  cd "${srcdir}"/${_realname}-${pkgver}
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
  mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-static \
    --enable-shared \
    --enable-introspection=yes

  make
}

package() {
  cd "${srcdir}"/build-${CARCH}
  make install DESTDIR="${pkgdir}"
}
